home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CON-03A.ZIP / PAGER.PAS < prev    next >
Pascal/Delphi Source File  |  1995-11-16  |  4KB  |  185 lines

  1. unit pager;
  2.  
  3. interface
  4. procedure read_strings;
  5. procedure bar;
  6. procedure init_asc;
  7. procedure write_to_log_file;
  8. procedure menu;
  9. procedure run_pager;
  10.  
  11. implementation
  12.  
  13. {$R-}
  14. uses crt,
  15.      funct,
  16.      mmenu;
  17.  
  18. var
  19.   f1               : text;
  20.   l                : text;
  21.   i                : byte;
  22.   place            : byte;
  23.   i2               : integer;
  24.   option           : integer;
  25.   options          : array[1..3] of string[70];
  26.   choice           : char;
  27.   grid_ref         : byte;
  28.   cows_come_home   : boolean;
  29.   liner            : string;
  30. {  lineswap         : array[1..16] of string[50];}
  31.   tmp11             : string[50];
  32.  
  33.  
  34. procedure read_strings;
  35. var
  36.   strfile       : text;
  37.   i3            : byte;
  38. begin
  39.   i3:=1;
  40.   assign(strfile,'data\strings.txt');
  41.   reset(strfile);
  42.   for i3 := 1 to 3 do
  43.     readln(strfile,options[i3]);
  44. end;
  45.  
  46.  
  47. procedure bar;
  48. begin
  49.   i2:=1;
  50.   place:=10;
  51.   gotoxy(place,10);
  52.   for i2 := 1 to 30 do
  53.   begin
  54.     textcolor(3);
  55.     textbackground(0);
  56.     write('░░');
  57.     delay(100);
  58.     sound(50);
  59.     gotoxy(place,10);
  60.     write('▒▒');
  61.     delay(100);
  62.     delay(150);
  63.     gotoxy(place,10);
  64.     write('▓▓');
  65.     delay(150);
  66.     gotoxy(place,10);
  67.     write('██');
  68.     nosound;
  69.     delay(170);
  70.     place:=place+2;
  71.   end;
  72.   main_menu;
  73. end;
  74.  
  75. procedure init_asc;
  76. var
  77.   ch        : char;
  78. begin
  79.   clrscr;
  80. {  assign(f1,'pager.pcb');
  81.    reset(f1);
  82.   repeat
  83.     read(f1,ch);
  84.     write(ch);
  85.   until eof(f1);}
  86.   send_ansi('page.pcb');
  87.   gotoxy(10,4);
  88.   write(options[1]);
  89.   gotoxy(10,5);
  90.   write(options[2]);
  91.   gotoxy(10,6);
  92.   write(options[3]);
  93. end;
  94.  
  95.  
  96. procedure write_to_log_file;
  97. begin
  98.   assign(l,'\logs\pagelog.dat');
  99.   reset(l);
  100.   append(l);
  101.   writeln(l,'groovyPAGE chat log reason');
  102.   close(l);
  103. end;
  104.  
  105.  
  106.  
  107. procedure menu;
  108. begin
  109.   gotoxy(10,4);
  110.   textcolor(0);
  111.   textbackground(3);
  112.   write(options[1]);
  113.   option:=1;
  114.   grid_ref:=4;
  115.   repeat
  116.   choice:=readkey;
  117.   case choice of
  118.     #13       : if option=1 then begin
  119.                   gotoxy(10,8);
  120.                   textcolor(3);
  121.                   textbackground(0);
  122.                   write(options[1]);
  123.                   bar;
  124.                 end else
  125.                 if option=2 then begin
  126.                   gotoxy(11,8);
  127.                   textcolor(3);
  128.                   textbackground(0);
  129.                   write(options[2]);
  130.                   bar;
  131.                   write_to_log_file;
  132.                 end else
  133.                 if option=3 then begin
  134.                   gotoxy(11,8);
  135.                   textcolor(3);
  136.                   textbackground(0);
  137.                   write(options[3]);
  138.                   bar;
  139.                 end;
  140.  
  141.     #27       : main_menu;
  142.     #80       : begin
  143.                   if option<3 then begin
  144.                     gotoxy(10,grid_ref);
  145.                     textbackground(0);
  146.                     textcolor(7);
  147.                     write(options[option]);
  148.                     inc(grid_ref);
  149.                     gotoxy(10,grid_ref);
  150.                     textbackground(3);
  151.                     textcolor(0);
  152.                     writeln(options[option+1]);
  153.                     option:=option+1;
  154.                   end else begin
  155.                     gotoxy(10,grid_ref);
  156.                     textcolor(7);
  157.                     textbackground(0);
  158.                     write(options[3]);
  159.                     grid_ref:=grid_ref-2;
  160.                     gotoxy(10,grid_ref);
  161.                     textbackground(3);
  162.                     textcolor(0);
  163.                     write(options[1]);
  164.                     option:=option-2;
  165.                   end;
  166.                 end;
  167.   end;
  168.   cows_come_home:=false;
  169.   until cows_come_home;
  170. end;
  171.  
  172.  
  173. procedure run_pager;
  174.  
  175. begin
  176.    textcolor(7);
  177.    textbackground(0);
  178.    clrscr;
  179.    read_strings;
  180.    init_asc;
  181.  { read_data_file;}
  182.  { init_oneliners;}
  183.    menu;
  184. end;
  185. end.